package traveler.tools;

import java.util.ArrayList;

import traveler.models.Course;

import android.database.DataSetObserver;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SpinnerAdapter;

public class GenericSpinner implements SpinnerAdapter
{
    private Object[] _items;
    
    public GenericSpinner()
    {
    	ArrayList<Course> courses = Course.getCourses();
    	_items = new Object[courses.size()];
    	
    	for(int i = 0; i < courses.size(); i++)
    		_items[i] = courses.get(i).getName();
    }
    
    public GenericSpinner(Object[] items)
    {
    	_items = items;
    }
    
	public int getCount()
	{
		return _items.length;
	}
	
	public Object getItem(int position)
	{
		return _items[position];
	}
	
	public long getItemId(int position)
	{
		return 0;
	}
	
	public int getItemViewType(int position)
	{
		return 0;
	}
	
	public View getView(int position, View convertView, ViewGroup parent)
	{
		return null;
	}
	
	public int getViewTypeCount()
	{
		return 0;
	}
	
	public boolean hasStableIds()
	{
		return false;
	}
	
	public boolean isEmpty()
	{
		return _items.length == 0;
	}
	
	public void registerDataSetObserver(DataSetObserver observer)
	{
		
	}
	
	public void unregisterDataSetObserver(DataSetObserver observer)
	{
		
	}
	
	public View getDropDownView(int position, View convertView, ViewGroup parent)
	{
		return null;
	}
}
